#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    int minCostClimbingStairs(vector<int>& cost) {
        vector<int> F(2,0);
        for(int i=2;i<=cost.size();i++){
            F.push_back(min(F[i-1]+cost[i-1],F[i-2]+cost[i-2]));
        }
        return *(F.end()-1);
    }
};

int main(){
    Solution S;
    vector<int> V = {1, 100, 1, 1, 1, 100, 1, 1, 100, 1};
    cout<<S.minCostClimbingStairs(V)<<endl;
}

